package com.sun.test;

public class Stringtest {
    public static void main(String[] args) {
        String s1 = new String("zs");
        String s2 = new String("zs");
        System.out.println(s1 == s2);//false

        String s3 = "zs";
        String s4 = "zs";
        System.out.println(s3 == s4);//true

        String s5 = "zszs";
        String s6 = s3 + s4;
        System.out.println(s5 == s6);//false

        final String s7 = "zs";
        final String s8 = "zs";
        String s9 = s7 + s8;
        System.out.println(s5 == s9);//true

        final String s10 = s3 + s4;
        System.out.println(s5 == s10);//false

        Integer i1 = 127;
        Integer i2 = 127;
        System.out.println(i1 == i2);

        Integer i3 = 128;
        Integer i4 = 128;
        System.out.println(i3.equals(i4));


    }
}
